home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 February: Tool Chest / Dev.CD Feb 94.toast / Tool Chest / Development Platforms / MPW Related / MPW Interfaces / CIncludes / Video.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-09-17  |  6.4 KB  |  186 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        Video.h
  3.  
  4.     Copyright:    © 1983-1993 by Apple Computer, Inc.
  5.                 All rights reserved.
  6.  
  7.     Version:    System 7.1 for ETO #11
  8.     Created:    Tuesday, March 30, 1993 18:00
  9.  
  10. */
  11.  
  12. #ifndef __VIDEO__
  13. #define __VIDEO__
  14.  
  15. #ifndef __QUICKDRAW__
  16. #include <Quickdraw.h>
  17. #endif
  18.  
  19.  
  20. enum {
  21.  
  22.     mBaseOffset = 1,            /*Id of mBaseOffset.*/
  23.     mRowBytes = 2,              /*Video sResource parameter Id's */
  24.     mBounds = 3,                /*Video sResource parameter Id's */
  25.     mVersion = 4,               /*Video sResource parameter Id's */
  26.     mHRes = 5,                  /*Video sResource parameter Id's */
  27.     mVRes = 6,                  /*Video sResource parameter Id's */
  28.     mPixelType = 7,             /*Video sResource parameter Id's */
  29.     mPixelSize = 8,             /*Video sResource parameter Id's */
  30.     mCmpCount = 9,              /*Video sResource parameter Id's */
  31.     mCmpSize = 10,              /*Video sResource parameter Id's */
  32.     mPlaneBytes = 11,           /*Video sResource parameter Id's */
  33.     mVertRefRate = 14,          /*Video sResource parameter Id's */
  34.     mVidParams = 1,             /*Video parameter block id.*/
  35.     mTable = 2,                 /*Offset to the table.*/
  36.     mPageCnt = 3,               /*Number of pages*/
  37.     mDevType = 4,               /*Device Type*/
  38.  
  39.     oneBitMode = 128,           /*Id of OneBitMode Parameter list.*/
  40.     twoBitMode = 129,           /*Id of TwoBitMode Parameter list.*/
  41.     fourBitMode = 130,          /*Id of FourBitMode Parameter list.*/
  42.     eightBitMode = 131          /*Id of EightBitMode Parameter list.*/
  43. };
  44. enum {
  45.     sixteenBitMode = 132,       /*Id of SixteenBitMode Parameter list.*/
  46.     thirtyTwoBitMode = 133,     /*Id of ThirtyTwoBitMode Parameter list.*/
  47.  
  48.     firstVidMode = 128,         /*The new, better way to do the above.    */
  49.     secondVidMode = 129,        /*    QuickDraw only supports six video    */
  50.     thirdVidMode = 130,         /*    at this time.                        */
  51.     fourthVidMode = 131,
  52.     fifthVidMode = 132,
  53.     sixthVidMode = 133,
  54.  
  55.     spGammaDir = 64,
  56.     spVidNamesDir = 65,
  57.  
  58. /* Control Codes */
  59.     cscReset = 0,
  60.     cscKillIO = 1,
  61.     cscSetMode = 2,
  62.     cscSetEntries = 3,
  63.     cscSetGamma = 4,
  64.     cscGrayPage = 5,
  65.     cscGrayScreen = 5,
  66.     cscSetGray = 6,
  67.     cscSetInterrupt = 7,
  68.     cscDirectSetEntries = 8
  69. };
  70. enum {
  71.     cscSetDefaultMode = 9,
  72.  
  73. /* Status Codes */
  74.     cscGetMode = 2,
  75.     cscGetEntries = 3,
  76.     cscGetPageCnt = 4,
  77.     cscGetPages = 4,            /* This is what C&D 2 calls it. */
  78.     cscGetPageBase = 5,
  79.     cscGetBaseAddr = 5,         /* This is what C&D 2 calls it. */
  80.     cscGetGray = 6,
  81.     cscGetInterrupt = 7,
  82.     cscGetGamma = 8,
  83.     cscGetDefaultMode = 9
  84. };
  85.  
  86. struct VPBlock {
  87.     long vpBaseOffset;          /*Offset to page zero of video RAM (From minorBaseOS).*/
  88.     short vpRowBytes;           /*Width of each row of video memory.*/
  89.     Rect vpBounds;              /*BoundsRect for the video display (gives dimensions).*/
  90.     short vpVersion;            /*PixelMap version number.*/
  91.     short vpPackType;
  92.     long vpPackSize;
  93.     long vpHRes;                /*Horizontal resolution of the device (pixels per inch).*/
  94.     long vpVRes;                /*Vertical resolution of the device (pixels per inch).*/
  95.     short vpPixelType;          /*Defines the pixel type.*/
  96.     short vpPixelSize;          /*Number of bits in pixel.*/
  97.     short vpCmpCount;           /*Number of components in pixel.*/
  98.     short vpCmpSize;            /*Number of bits per component*/
  99.     long vpPlaneBytes;          /*Offset from one plane to the next.*/
  100. };
  101.  
  102. typedef struct VPBlock VPBlock;
  103. typedef VPBlock *VPBlockPtr;
  104.  
  105. struct VDEntryRecord {
  106.     Ptr csTable;                /*(long) pointer to color table entry=value, r,g,b:INTEGER*/
  107. };
  108.  
  109. typedef struct VDEntryRecord VDEntryRecord;
  110. typedef VDEntryRecord *VDEntRecPtr;
  111.  
  112. /* Parm block for SetGray control call */
  113. struct VDGrayRecord {
  114.     Boolean csMode;             /*Same as GDDevType value (0=mono, 1=color)*/
  115. };
  116.  
  117. typedef struct VDGrayRecord VDGrayRecord;
  118. typedef VDGrayRecord *VDGrayPtr;
  119.  
  120. /* Parm block for SetEntries control call */
  121. struct VDSetEntryRecord {
  122.     ColorSpec *csTable;         /*Pointer to an array of color specs*/
  123.     short csStart;              /*Which spec in array to start with, or -1*/
  124.     short csCount;              /*Number of color spec entries to set*/
  125. };
  126.  
  127. typedef struct VDSetEntryRecord VDSetEntryRecord;
  128. typedef VDSetEntryRecord *VDSetEntryPtr;
  129.  
  130. /* Parm block for SetGamma control call */
  131. struct VDGammaRecord {
  132.     Ptr csGTable;               /*pointer to gamma table*/
  133. };
  134.  
  135. typedef struct VDGammaRecord VDGammaRecord;
  136. typedef VDGammaRecord *VDGamRecPtr;
  137.  
  138. struct VDPageInfo {
  139.     short csMode;               /*(word) mode within device*/
  140.     long csData;                /*(long) data supplied by driver*/
  141.     short csPage;               /*(word) page to switch in*/
  142.     Ptr csBaseAddr;             /*(long) base address of page*/
  143. };
  144.  
  145. typedef struct VDPageInfo VDPageInfo;
  146. typedef VDPageInfo *VDPgInfoPtr;
  147.  
  148. struct VDSizeInfo {
  149.     short csHSize;              /*(word) desired/returned h size*/
  150.     short csHPos;               /*(word) desired/returned h position*/
  151.     short csVSize;              /*(word) desired/returned v size*/
  152.     short csVPos;               /*(word) desired/returned v position*/
  153. };
  154.  
  155. typedef struct VDSizeInfo VDSizeInfo;
  156. typedef VDSizeInfo *VDSzInfoPtr;
  157.  
  158. struct VDSettings {
  159.     short csParamCnt;           /*(word) number of params*/
  160.     short csBrightMax;          /*(word) max brightness*/
  161.     short csBrightDef;          /*(word) default brightness*/
  162.     short csBrightVal;          /*(word) current brightness*/
  163.     short csCntrstMax;          /*(word) max contrast*/
  164.     short csCntrstDef;          /*(word) default contrast*/
  165.     short csCntrstVal;          /*(word) current contrast*/
  166.     short csTintMax;            /*(word) max tint*/
  167.     short csTintDef;            /*(word) default tint*/
  168.     short csTintVal;            /*(word) current tint*/
  169.     short csHueMax;             /*(word) max hue*/
  170.     short csHueDef;             /*(word) default hue*/
  171.     short csHueVal;             /*(word) current hue*/
  172.     short csHorizDef;           /*(word) default horizontal*/
  173.     short csHorizVal;           /*(word) current horizontal*/
  174.     short csHorizMax;           /*(word) max horizontal*/
  175.     short csVertDef;            /*(word) default vertical*/
  176.     short csVertVal;            /*(word) current vertical*/
  177.     short csVertMax;            /*(word) max vertical*/
  178. };
  179.  
  180. typedef struct VDSettings VDSettings;
  181. typedef VDSettings *VDSettingsPtr;
  182.  
  183.  
  184.  
  185. #endif
  186.